package org.stone.project.common.pojo.sysEnum;

import org.stone.project.common.pojo.annotation.MarkEnum;

/**
 * 菜单组件模板
 */
@MarkEnum("menuComponentTypeEnum")
public enum MenuComponentTypeEnum {
    PARENT_VIEW("ParentView","父视图，页面显示将包子菜单"),
    LAYOUT("Layout","局部视图，页面只包含某个前端具体组件"),
    INNER_LINK("InnerLink","外部链接，内部嵌套"),
    OTHER("OTHER","其他组件"),
    ;
    private String code;
    private String describStr;

    MenuComponentTypeEnum(String code, String describStr) {
        this.code = code;
        this.describStr = describStr;
    }


    public String getCode() {
        return code;
    }

    public String getDescribStr() {
        return describStr;
    }


    /**
     * 根据code获取实例
     * @param code
     * @return
     */
    public static MenuComponentTypeEnum getInstance(String code){
        if (code == null)
            return null;
        for (MenuComponentTypeEnum value : values()) {
            if (value.getCode().equals(code))
                return value;
        }
        return null;
    }
}
